refactor code base and setup build workflows