Fixed the refactoring issue a bit