Code cleanup. Moving implementation from .h to .cpp file.