initial commit of cleaner refactor of code
reworked for cleaner code