Refactor + update buildfile.