Improved and refactored menu generation and cleaned phpcs