refactored constants; generate housekeeping funcs in factory methods for easier unit testing