refactored code and cleaned up admin public folder