Implemented setup command, code cleanup