Refactoring buildprocess