cleaned code (refactoring only)