slight updates, refactoring