all code is refactored