First attempt at modularizing