Fixed before functions in controllers
Removed duplicate files