Replace some if statements with ternary, added .idea back to git.