design changed, small refactoring made