Refactored packages, made the different layers clearer.