Removed duplicate function and imports