refactor and prepare for maven