removed static
cleaned up code