refactored! :)