Moved parsing of buttons to a helper method.
Small changes and fixes.