More organized Python code