Cleanup + refactor