Cleanup code & phpdocs