moving code to modules