Cleaned up code + added custom message