restructuring by moving stuff out into the lib folder