this should be moved to header file