Refactoring + clean up