minor refactoring, got rid of redundant code