refactoring. check if not broken