refactored :)