Cleaned up some dirty codes