refactoring
more refactoring
finished refactoring
added comments