Refactor/fix build()