Removed function declarations from if blocks