Refactoring/cleanup