Added request logging and some clean-up