cleaned up method