replaced tabs
started code refactoring