much refactoring :P