working to modularize