little bit refactoryng