implemented changes as suggested by AndreiH's code review

I also added pep8 checks to Aptana, so I hope I won't have so many code
style comments from now on :)