separate concerns into various files
refactor to use factory