code partitioned to new file