Removed unnecessary files and converted to application funciton