Adds prototype building and cleans up code