refactoring some shit