Refactors Junits and code as well