refactoring, fixed bug