refactor main function into separate namespace