Few refactorings
Added command line options