Clean up code and update deprecated code.
Merge pull request #2 from artursvonda/update-deprecated-code

Clean up code and update deprecated code.