refactored to remove environment attribute and unnecessary methods