Cleaned up some funcationality