#129 refactoring dirty codes