cleaned up code in custom