cleaned up contract