How do you renovate a tiny, traditional house set into a narrow “hutong” alley in Beijing so it fits a large family spanning three generations? Chinese architecture firm B.L.U.E. clearly has plenty of answers to that question up their collective sleeve, judging by two highly functional homes they’ve completed this year. No lot is too small or oddly-shaped to host a residence packed full of every feature a family could possibly need, thanks mostly to a series of incredibly clever built-ins.

The first example is a tenement house on a lot measuring no more than 258 square feet, which had to fit a family of five, including the owners, their parents and their children. On top of that, each member of the family requested their own private space. Seems impossible, right? But check out what B.L.U.E. did to make that dream a reality.

The home butts right up against the exterior wall of a neighboring residence, so creative daylighting was required. The architects made half of the ceiling glass to compensate for the lack of windows, filling the center of the home with sunlight that reflects from white tiles and cabinetry.

The master bedroom and children’s room bleed into one another in the upstairs loft, which looks down onto the living room and its small, sunny library. A third bedroom space doubles as an extra dining area downstairs, the mattress folding up to reveal a pop-up table with bench seating. Storage cubes double as seats for a second fold-down dining table mounted to the wall, and can be pushed against the bed when not in use. Shades pull down from the ceiling for privacy.

But the most integral element that makes all of this work is the fact that every single downstairs wall is packed with hidden compartments revealing storage, extra countertops, appliances and more when opened.

In the second example, an L-shaped site measuring 462 square feet, B.L.U.E. makes space for a family of six between an existing hutong wall and a two-story building. The coolest part is definitely the rear entrance facing the private courtyard: there’s an ordinary door, but the entire glassed-in wall is actually on hinges, and can be opened to the fresh air to make the space feel larger.

Inside, the architects take full advantage of the double-height space, placing skylights along the section of ceiling that meets a white wall full of cabinets and inserting lofts into the rest of the upper level area. One lofted bedroom places a mattress on top of and between built-in storage, alongside a wall-mounted desk. The elevated children’s play area features grass-like carpeting and netting to mimic the feel of an outdoor space.

Downstairs, a sliding wall makes more room to either transform a reading nook into a full-sized bed or allow an additional fold-down desk to be extended in the office area. A slide-out wall sections off the bedroom when privacy is desired. An additional nook full of bench seating serves as the living room, and the dining table pulls out from a compact arrangement to a space that can accommodate a large group.

Stairs double as drawers, dressing tables and closets are hidden in the pale wood built-in wall and even more surprises can be found the more you push and pull. All in all, it’s a pretty awesome display of space-maximizing prowess.