type optimalisation + indention cleanup