Moved executable code out of header files into .cpp files