refactoring starting :D