Attempting to modularize (Tests not passing)