refactored, renamed, tested