drop code into small modules for better reuse