Refactoring into .h and .cpp