Remove intellij cruft and cleanup some code